#pragma once 
#include <iostream>

#define CLIP_UIN8(v_s32) (((v_s32) & (~255)) ? (uint8_t)((-v_s32)>>31) : (uint8_t)(v_s32))

class HumanSegBase
{
public:
	HumanSegBase(const char *model_name, int model_width, int model_height, int is_video, int enable_debug);
	virtual ~HumanSegBase();
public:
	virtual int detect_rgb24_do(unsigned char *buf_rgb, int src_pitch, unsigned char *alpha, int alpha_pitch) = 0;
public:
	int detect_i420(int width, int height, unsigned char **src_plane, int *src_pitch, unsigned char *alpha, int alpha_pitch);
	int detect_rgb24(int width, int height, unsigned char *buf_rgb, int src_pitch, unsigned char *alpha, int alpha_pitch);
	
	int bg_replace_i420(int width, int height, unsigned char **fg_plane, int *fg_pitch, 
				unsigned char **bg_plane, int *bg_pitch, unsigned char **mix_plane, int *mix_pitch,
				unsigned char *alpha, int alpha_pitch);

	int bg_replace_rgb24(int width, int height, unsigned char *fg_buf, int fg_pitch, 
				unsigned char *bg_buf, int bg_pitch, unsigned char *mix_buf, int mix_pitch,
				unsigned char *alpha, int alpha_pitch);

	
protected:
	std::string model_name_;
	int 		model_width_;
	int 		model_height_;
	int 		is_video_;
	int 		enable_debug_;
private:
	void 		*priv_data_;
	
	
};



